<template>
  <div id="app">
    <!-- 顶部导航 -->
    <l-topbar :navConfig='navConfig' ></l-topbar>

    <!-- 主体内容 -->
    <div class="app-container" v-if='showApp'>
      <router-view/>
    </div>

    <!-- 页脚 -->
    <l-page-footer></l-page-footer>
    
  </div>
</template>

<script>
import topbar from '@/components/topbar/index.vue';
import pageFooter from '@/components/page_footer/index.vue';

export default {

  created(){

    let _this = this;

    // 获取筛选配置
    this.$API.getSearchConfig().then(res =>{
      _this.$globState['searchConfig'] = res
      _this.showApp = true
    })
    
  },

  data (){
    return {

      showApp: false,
      
      navConfig: [

        {
          path: '/home',
          label: '用家买车',
          exact: true
        },
        {
          path: '/car-list',
          label: '车行列表'
        },
        {
          path: '/car-serve-detaild',
          label: '车牌出让'
        },
        {
          path: '/car-license-plate',
          label: '汽车文化'
        },
        {
          path: '/car-serve-list',
          label: '汽车服务'
        },
        
      ]
    }
  },

  components:{
    'l-topbar': topbar,
    'l-page-footer': pageFooter
  }
  
  
}

  
</script>
<style lang="less">

#app{
  height: 100%;
}

.app-container{
  
  
}

</style>
